home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / rkeyboar.cpt / Reactive Keyboard ƒ / hlp.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-20  |  18.5 KB  |  682 lines

  1. /*______________________________________________________________________
  2.  
  3.     hlp.c - Help Module.
  4.     
  5.     Copyright ⌐ 1988, 1989, 1990 Northwestern University.  Permission is 
  6.     granted to use this code in your own projects, provided you give credit 
  7.     to both John Norstad and Northwestern University in your about box or 
  8.     document.
  9.     
  10.     This reusable module implements help windows.  The help window contains
  11.     a scrolling field containing the text and an optional table of contents.
  12.     
  13.     The caller supplies several resources - a WIND resource for the window,
  14.     a sequence of STR# resources containing the text, and a TCON resource 
  15.     for the table of contents.
  16.     
  17.     The sequence of STR# resources must be terminated by an empty STR#
  18.     resource (an STR# resource of size 2 containing 0 strings).
  19.     
  20.     There is a limit of 8k lines of text in the help window
  21. _____________________________________________________________________*/
  22.  
  23.  
  24. #include "MacIncludes.h"
  25. #include "rep.h"
  26. #include "rpp.h"
  27. #include "utl.h"
  28. #include "hlp.h"
  29. #include "doc.h"
  30.  
  31. #pragma segment hlp
  32.  
  33. /*______________________________________________________________________
  34.  
  35.     Global Constants and Variables.
  36. _____________________________________________________________________*/
  37.  
  38. static    hlp_PBlock         P;                        /* param block */
  39. static    WindowPtr        HelpWindow;            /* pointer to window record */
  40. static    Handle            Report;                /* handle to report */
  41. static    Handle            TabConRez;            /* handle to TCON resource */
  42.  
  43. static    short                TopLine;        /* line number of top line in table
  44.                                                     of contents rectangle */
  45. static    short                BotLine;        /* line number of bottom line in table
  46.                                                     of contents rectangle */
  47. static    short                LastLine;    /* line number of last line in table
  48.                                                     of contents */
  49. static    short                LastCell;    /* cell number of last cell in table
  50.                                                     of contents rectangle */
  51.                                                     
  52. static    Rect                Cell1Rect;    /* top cell rectangle */
  53. static    Rect                Cell2Rect;    /* second cell rectangle */
  54. static    Rect                CellARect;    /* second to bottom cell rectangle */
  55. static    Rect                CellBRect;    /* bottom cell rectangle */
  56.  
  57. static    Rect                TCScrollRect;    /* table of contents scrolling
  58.                                                         rectangle */
  59.                                                     
  60. static    RgnHandle        UpdateRgn;    /* update region for ScrollRect calls */                                                    
  61.                                                 
  62. static     PolyHandle        TopTri;        /* top table of contents scrolling 
  63.                                                     triangle */
  64. static    PolyHandle        BotTri;        /* bottom table of contents scrolling
  65.                                                     triangle */
  66.  
  67. /*______________________________________________________________________
  68.  
  69.     DelayScroll - Slow Down Scrolling.
  70.     
  71.     Entry:    n = delay factor (smaller value = longer delay).
  72. _____________________________________________________________________*/
  73.  
  74.  
  75. static void DelayScroll (short n)
  76.  
  77. {
  78.     long            waitTill;
  79.  
  80.     if (n >= 32) return;
  81.     waitTill = TickCount() + 8 - (n>>2);
  82.     while (TickCount() < waitTill) {
  83.         if (!StillDown()) break;
  84.     };
  85. }
  86.  
  87. /*______________________________________________________________________
  88.  
  89.     GetLine - Get Table of Contents Line.
  90.     
  91.     Entry:    n = line number.
  92.                 
  93.     Exit:        function result = pointer to line.
  94. _____________________________________________________________________*/
  95.  
  96.  
  97. static char *GetLine (short n)
  98.  
  99. {
  100.     char        *q;
  101.     
  102.     q = *TabConRez + 4;
  103.     while (true) {
  104.         if (*q & docScreen) {
  105.             if (n) {
  106.                 n--;
  107.             } else {
  108.                 return q+1;
  109.             };
  110.         };
  111.         q += *(q+1) + 4;
  112.         if ((long)q & 1) q++;
  113.     };
  114. }
  115.  
  116. /*______________________________________________________________________
  117.  
  118.     DoTcon - Check for and Process Mouse Down in Table of Contents.
  119.     
  120.     Entry:    where = location of mouse down event, in local coords.
  121. _____________________________________________________________________*/
  122.  
  123.  
  124. static void DoTcon (Point where)
  125.  
  126. {
  127.     Point                curLoc;                /* current mouse loc */
  128.     short                oldCell;                /* old cell pos, or -1 if none. */
  129.     short                newCell;                /* new cell pos, or -1 if none */
  130.     char                *p;                    /* pointer into TCON resource */
  131.     Rect                frameRect;            /* rect enclosing table of contents */
  132.     Rect                invertRect;            /* rect to be inverted */
  133.     long                startTicks;            /* tick count at mouse down */
  134.                                 
  135.     /* Return if mouse loc is not in the table of contents rectangle. */
  136.                                                     
  137.     curLoc = where;
  138.     frameRect = P.tabConRect;
  139.     InsetRect(&frameRect, 1, 1);
  140.     if (!PtInRect(curLoc, &frameRect)) return;
  141.     
  142.     /* Track the mouse and hilite the table of contents lines. */
  143.     
  144.     oldCell = -1;
  145.     invertRect = frameRect;
  146.     startTicks = TickCount();
  147.     while (true) {
  148.         if (PtInRect(curLoc, &frameRect)) {
  149.             newCell = (curLoc.v - frameRect.top - 1) / P.tabConLSep;
  150.         } else if (curLoc.h >= frameRect.left && curLoc.h <= frameRect.right) {
  151.             if (TopLine && curLoc.v <= frameRect.top) {
  152.                 newCell = 0;
  153.             } else if (BotLine < LastLine && curLoc.v >= frameRect.bottom) {
  154.                 newCell = LastCell;
  155.             } else {
  156.                 newCell = -1;
  157.             };
  158.         } else { 
  159.             newCell = -1;
  160.         };
  161.         if (newCell != oldCell) {
  162.             if (oldCell >= 0) {
  163.                 invertRect.top = frameRect.top + P.tabConLSep*oldCell;
  164.                 invertRect.bottom = invertRect.top + P.tabConLSep;
  165.                 InvertRect(&invertRect);
  166.             };
  167.             if (newCell >= 0) {
  168.                 if (!newCell && TopLine) {
  169.                     /* scroll down 1 line */
  170.                     ScrollRect(&TCScrollRect, 0, P.tabConLSep, UpdateRgn);
  171.                     SetOrigin(0, 0);
  172.                     p = GetLine(TopLine);
  173.                     TextBox(p+1, *p, &Cell2Rect, teJustLeft);
  174.                     TopLine--;
  175.                     if (!TopLine) {
  176.                         EraseRect(&Cell1Rect);
  177.                         p = GetLine(0);
  178.                         TextBox(p+1, *p, &Cell1Rect, teJustLeft);
  179.                     };
  180.                     if (BotLine == LastLine) {
  181.                         EraseRect(&CellBRect);
  182.                         PaintPoly(BotTri);
  183.                     };
  184.                     BotLine--;
  185.                     newCell = -1;
  186.                     if (TopLine) {
  187.                         GetMouse(&curLoc);
  188.                         DelayScroll(Cell2Rect.top - curLoc.v);
  189.                     };
  190.                 } else if (newCell == LastCell && BotLine < LastLine) {
  191.                     /* scroll up 1 line */
  192.                     ScrollRect(&TCScrollRect, 0, -P.tabConLSep, UpdateRgn);
  193.                     SetOrigin(0, 0);
  194.                     p = GetLine(BotLine);
  195.                     TextBox(p+1, *p, &CellARect, teJustLeft);
  196.                     BotLine++;
  197.                     if (BotLine == LastLine) {
  198.                         EraseRect(&CellBRect);
  199.                         p = GetLine(LastLine);
  200.                         TextBox(p+1, *p, &CellBRect, teJustLeft);
  201.                     };
  202.                     if (!TopLine) {
  203.                         EraseRect(&Cell1Rect);
  204.                         PaintPoly(TopTri);
  205.                     };
  206.                     TopLine++;
  207.                     newCell = -1;
  208.                     if (BotLine < LastLine) {
  209.                         GetMouse(&curLoc);
  210.                         DelayScroll(curLoc.v - CellARect.bottom);
  211.                     };
  212.                 } else {
  213.                     invertRect.top = frameRect.top + P.tabConLSep*newCell;
  214.                     invertRect.bottom = invertRect.top + P.tabConLSep;
  215.                     InvertRect(&invertRect);
  216.                 };
  217.             };
  218.             oldCell = newCell;
  219.         };
  220.         if (!StillDown()) break;
  221.         GetMouse(&curLoc);
  222.     };
  223.     
  224.     /* Jump to the selected section. */
  225.     
  226.     if ((newCell >= 0) && 
  227.         (newCell || !TopLine) && 
  228.         (newCell < LastCell || BotLine == LastLine)) {
  229.         while (TickCount() < startTicks+8);
  230.         invertRect.top = frameRect.top + P.tabConLSep*newCell;
  231.         invertRect.bottom = invertRect.top + P.tabConLSep;
  232.         InvertRect(&invertRect);
  233.         p = GetLine(newCell + TopLine) - 3;
  234.         rep_Jump(Report, *((short*)p), true);
  235.     };
  236. }
  237.  
  238. /*______________________________________________________________________
  239.  
  240.     DrawTcon - Draw the Table of Contents.
  241. _____________________________________________________________________*/
  242.  
  243.  
  244. static void DrawTcon (void)
  245.  
  246. {
  247.     Rect                theBox;                /* rectangle enclosing cur line */
  248.     char                *q;                    /* pointer into TCON resource */
  249.     short                oldFont;                /* saved font number */
  250.     short                oldSize;                /* saved font size */
  251.     Rect                frameBox;            /* box for framing */
  252.     short                i;                        /* cell index */
  253.     
  254.     theBox = Cell1Rect;
  255.     oldFont = qd.thePort->txFont;
  256.     oldSize = qd.thePort->txSize;
  257.     TextFont(P.tabConFNum);
  258.     TextSize(P.tabConFSize);
  259.     for (i = 0; i <= LastCell; i++) {
  260.         if (!i && TopLine) {
  261.             PaintPoly(TopTri);
  262.         } else if (i == LastCell && BotLine < LastLine) {
  263.             PaintPoly(BotTri);
  264.         } else {
  265.             q = GetLine(TopLine+i);
  266.             TextBox(q+1, *q, &theBox, teJustLeft);
  267.         };
  268.         OffsetRect(&theBox, 0, P.tabConLSep);
  269.     };
  270.     TextFont(oldFont);
  271.     TextSize(oldSize);
  272.     frameBox = P.tabConRect;
  273.     FrameRect(&frameBox);
  274.     MoveTo(frameBox.right, frameBox.top+2);
  275.     LineTo(frameBox.right, frameBox.bottom);
  276.     LineTo(frameBox.left+2, frameBox.bottom);
  277. }
  278.  
  279. /*______________________________________________________________________
  280.  
  281.     hlp_Open - Open Help Window.
  282.     
  283.     Entry:    theWindow = pointer to opened window, positioned and sized,
  284.                     invisible.
  285.                     
  286.                 p = pointer to parameter block, with fields set as follows:
  287.     
  288.                 firstStrID = resource id of first STR# resource.
  289.                 listDefID = resource id of type 1 report LDEF.
  290.                 textRect = rectangle enclosing the text and its scroll bar.
  291.                 fontNum = font number for text.
  292.                 fontSize = font size for text.
  293.                 tabConID = resource id of TCON resource.
  294.                 tabConRect = rectangle for table of contents.
  295.                 tabConFNum = table of contents font number.
  296.                 tabConFSize = table of contents font size.
  297.                 tabConLSep = table of contents line separation, in pixels.
  298.                 tag = tag of line to jump to initially, or 0 if none.  Takes
  299.                     precedence over scrollLine.
  300.                 tagRezID = resource id of TAG resource.
  301.                 scrollLine = line number of line to jump to initially.
  302.                 cellRezID = resource id of CELL resource.
  303.                 cellOption = CELL resource disposal option:
  304.                     0 = release the CELL resource.
  305.                     1 = keep the CELL resource, and leave it purgable.
  306.                     2 = keep the CELL resource, and leave it unpurgable.
  307.                 extraUpdate = pointer to a funtion to be called during
  308.                     update event processing, or nil if none.  This function 
  309.                     can draw any extra decorative stuff in the help window 
  310.                     (e.g., a "Table of Contents" title above the table of 
  311.                     contents).
  312.                     
  313.     Exit:        window initialized and shown.
  314.     
  315.     For best results, the textRect rectangle height should 2 more than an 
  316.     even multiple of the window font's ascent plus descent plus leading
  317.     (12 for Geneva 9).  This will make an even number of rows appear in 
  318.     the rectangle, which makes scrolling look nice.
  319.         
  320.     Similarly, the tabConRect rectangle height should be 2 more than an 
  321.     even multiple of tabConLSep.  If this rectangle is not tall enough to 
  322.     contain all of the table of contents lines, then the menu will scroll.
  323. _____________________________________________________________________*/
  324.  
  325.  
  326. void hlp_Open (WindowPtr theWindow, hlp_PBlock *p)
  327.     
  328. {
  329.     short                h, v;                    /* h and v coords for triangles */
  330.     short                tsize;                /* size (height) of triangles */
  331.     unsigned char    *q;                    /* ptr into TCON resource */
  332.     short                n;                        /* loop index */
  333.     
  334.     P = *p;
  335.     HelpWindow = theWindow;
  336.     SetPort(HelpWindow);
  337.  
  338.     /* Initialize table of contents. */
  339.     
  340.     /* Create the top and bottom table of contents scrolling triangles. */
  341.  
  342.     h = p->tabConRect.left + 5;
  343.     v = p->tabConRect.top + p->tabConLSep + 1 - 
  344.         ((p->tabConLSep-p->tabConFSize)>>1);
  345.     tsize = p->tabConFSize-2;
  346.     TopTri = OpenPoly();
  347.     MoveTo(h,v);
  348.     Line(tsize<<1, 0);
  349.     Line(-tsize, -tsize);
  350.     LineTo(h, v);
  351.     ClosePoly();
  352.     v = p->tabConRect.bottom - p->tabConLSep - 1 + 
  353.         ((p->tabConLSep-p->tabConFSize)>>1);
  354.     BotTri = OpenPoly();
  355.     MoveTo(h,v);
  356.     Line(tsize<<1, 0);
  357.     Line(-tsize, tsize);
  358.     LineTo(h, v);
  359.     ClosePoly();
  360.  
  361.     /* Load and lock the TCON resource. */
  362.  
  363.     TabConRez = GetResource('TCON', p->tabConID);
  364.     MoveHHi(TabConRez);
  365.     HLock(TabConRez);
  366.     
  367.     /* Initialize global variables. */
  368.     
  369.     TopLine = 0;
  370.     q = *TabConRez + 4;
  371.     LastLine = -1;
  372.     for (n = 0; n < **(short**)TabConRez; n++) {
  373.         if (*q & docScreen) LastLine++;
  374.         q += *(q+1) + 4;
  375.         if ((long)q & 1) q++;
  376.     };
  377.     LastCell = (p->tabConRect.bottom - p->tabConRect.top - 2) /
  378.         p->tabConLSep - 1;
  379.     BotLine = LastCell;
  380.     UpdateRgn = NewRgn();
  381.     Cell1Rect = p->tabConRect;
  382.     InsetRect(&Cell1Rect, 4, 1);
  383.     CellBRect = TCScrollRect = Cell1Rect;
  384.     Cell1Rect.bottom = Cell1Rect.top + p->tabConLSep;
  385.     Cell2Rect = Cell1Rect;
  386.     OffsetRect(&Cell2Rect, 0, p->tabConLSep);
  387.     CellBRect.top = CellBRect.bottom - p->tabConLSep;
  388.     CellARect = CellBRect;
  389.     OffsetRect(&CellARect, 0, -p->tabConLSep);
  390.     TCScrollRect.top += p->tabConLSep;
  391.     TCScrollRect.bottom -= p->tabConLSep;
  392.     
  393.     /* Set the window's font id and size. */
  394.     
  395.     TextFont(p->fontNum);
  396.     TextSize(p->fontSize);
  397.     
  398.     /* Initialize the report. */
  399.     
  400.     rep_Init(&p->textRect, HelpWindow, 1, p->firstStrID, p->listDefID, 
  401.         p->cellRezID, &Report);
  402.     if (p->tag) {
  403.         rep_Jump(Report, rep_Tag(p->tagRezID, p->tag), false);
  404.     } else if (p->scrollLine) {
  405.         rep_Jump(Report, p->scrollLine, false);
  406.     };
  407.     
  408.     /* Size the window. */
  409.     
  410.     hlp_Zoom();
  411.     
  412.     /* Show the window. */
  413.     
  414.     utl_LockControls(HelpWindow);
  415.     ShowWindow(HelpWindow);
  416. }
  417.  
  418. /*______________________________________________________________________
  419.  
  420.     hlp_Close - Close Help Window.
  421.     
  422.     Exit:            auxiliary data structures deallocated.
  423.     
  424.     It is the callers responsibility to actually dispose of the window
  425.     proper.
  426. _____________________________________________________________________*/
  427.  
  428.  
  429. void hlp_Close (void)
  430.  
  431. {
  432.     SetPort(HelpWindow);
  433.     HUnlock(TabConRez);
  434.     KillPoly(TopTri);
  435.     KillPoly(BotTri);
  436.     DisposeRgn(UpdateRgn);
  437.     rep_Dispose(Report, P.cellOption);
  438. }
  439.  
  440. /*______________________________________________________________________
  441.  
  442.     hlp_Click - Process Mouse Down Event.
  443.     
  444.     Entry:        where = mouse down location, local coords.
  445. _____________________________________________________________________*/
  446.  
  447.  
  448. void hlp_Click (Point where)
  449.  
  450. {
  451.     Rect                repRect;            /* report rectangle */
  452.  
  453.     rep_GetRect(Report, &repRect);
  454.     if (PtInRect(where, &repRect)) {
  455.         rep_Scroll(Report, where);
  456.     } else {
  457.         DoTcon(where);
  458.     };
  459. }
  460.  
  461. /*______________________________________________________________________
  462.  
  463.     hlp_Activate - Process Activate Event.
  464. _____________________________________________________________________*/
  465.  
  466.  
  467. void hlp_Activate (void)
  468.  
  469. {
  470.     rep_Activate(Report, true);
  471.     utl_DrawGrowIcon(HelpWindow);
  472. }
  473.  
  474. /*______________________________________________________________________
  475.  
  476.     hlp_Deactivate - Process Deactivate Event.
  477. _____________________________________________________________________*/
  478.  
  479.  
  480. void hlp_Deactivate (void)
  481.  
  482. {
  483.     rep_Activate(Report, false);
  484.     utl_DrawGrowIcon(HelpWindow);
  485. }
  486.  
  487. /*______________________________________________________________________
  488.  
  489.     hlp_Update - Process Update Event.
  490.     
  491.     It is the caller's responsibility to set the port to the help window,
  492.     call BeginUpdate, and erase the portrect before calling this routine,
  493.     and to call EndUpdate after calling it.
  494. _____________________________________________________________________*/
  495.  
  496.  
  497. void hlp_Update (void)
  498.  
  499. {
  500.     DrawTcon();
  501.     rep_Update(Report);
  502.     utl_DrawGrowIcon(HelpWindow);
  503.     if (P.extraUpdate) (*P.extraUpdate)();
  504. }
  505.  
  506. /*______________________________________________________________________
  507.  
  508.     hlp_Key - Process Key Event.
  509.     
  510.     Entry:        key = ascii code of key pressed.
  511.                     modifiers = key modifiers.
  512. _____________________________________________________________________*/
  513.  
  514.  
  515. void hlp_Key (short key, short modifiers)
  516.  
  517. {
  518.     
  519.     if (key == upArrow || key == downArrow) {
  520.         (void) rep_Key(Report, key, modifiers);
  521.     };
  522. }
  523.  
  524. /*______________________________________________________________________
  525.  
  526.     hlp_Jump - Jump to a Tag.
  527.     
  528.     Entry:        tag = tag to jump to.
  529. _____________________________________________________________________*/
  530.  
  531.  
  532. void hlp_Jump (short tag)
  533.  
  534. {
  535.     rep_Jump(Report, rep_Tag(P.tagRezID, tag), true);
  536. }
  537.  
  538. /*______________________________________________________________________
  539.  
  540.     hlp_Print - Print Help Text.
  541.     
  542.     Entry:        p = pointer to print parameter block.
  543.                     printOne = true to bypass print job dialog.
  544.                     
  545.     Exit:            function result = error code.
  546. _____________________________________________________________________*/
  547.     
  548.     
  549. OSErr hlp_Print (rpp_PrtBlock *p, Boolean printOne)
  550.  
  551. {
  552.     return rpp_Print(Report, printOne, p);
  553. }
  554.  
  555. /*______________________________________________________________________
  556.  
  557.     ChangeSize - Process Window Size Change.
  558.     
  559.     Entry:    height = new window height.
  560. _____________________________________________________________________*/
  561.  
  562.  
  563. static void ChangeSize (short height)
  564.  
  565. {
  566.     short            newTabConHeight;            /* new tcon rect height */
  567.     short            newLastCell;                /* new cell num of last cell */
  568.     short            deltaCell;                    /* change in number of cells */
  569.     short            deltaHeight;                /* change in height of tcon rect */
  570.     Rect            inval;                        /* rect to be invalidated */
  571.     
  572.     /* Change report size. */
  573.     
  574.     rep_Height(Report, height - 6);
  575.     
  576.     /* Change table of contents size. */
  577.     
  578.     newTabConHeight = height - 20 - P.tabConRect.top;
  579.     newTabConHeight -= (newTabConHeight - 2) % P.tabConLSep;
  580.     newLastCell = (newTabConHeight - 2) / P.tabConLSep - 1;
  581.     if (newLastCell > LastLine) newLastCell = LastLine;
  582.     deltaCell = newLastCell - LastCell;
  583.     deltaHeight = deltaCell * P.tabConLSep;
  584.     P.tabConRect.bottom += deltaHeight;
  585.     LastCell = newLastCell;
  586.     BotLine += deltaCell;
  587.     if (BotLine > LastLine) {
  588.         TopLine -= BotLine-LastLine;
  589.         BotLine = LastLine;
  590.     };
  591.     OffsetRect(&CellARect, 0, deltaHeight);
  592.     OffsetRect(&CellBRect, 0, deltaHeight);
  593.     TCScrollRect.bottom += deltaHeight;
  594.     OffsetPoly(BotTri, 0, deltaHeight);
  595.     inval = P.tabConRect;
  596.     inval.right += 1;
  597.     inval.bottom = HelpWindow->portRect.bottom;
  598.     InvalRect(&inval);
  599. }
  600.  
  601. /*______________________________________________________________________
  602.  
  603.     hlp_Grow - Process Window Grow Operation.
  604.     
  605.     Entry:    height = new window height.
  606.                 width = new window width.
  607. _____________________________________________________________________*/
  608.  
  609.  
  610. void hlp_Grow (short height, short width)
  611.  
  612. {
  613.     utl_InvalGrow(HelpWindow);
  614.     SizeWindow(HelpWindow, width, height, true);
  615.     utl_InvalGrow(HelpWindow);
  616.     ChangeSize(height);
  617. }
  618.     
  619. /*______________________________________________________________________
  620.  
  621.     hlp_Zoom - Process Window Zoom Operation.
  622. _____________________________________________________________________*/
  623.  
  624.  
  625. void hlp_Zoom (void)
  626.  
  627. {
  628.     ChangeSize(HelpWindow->portRect.bottom - HelpWindow->portRect.top);
  629. }
  630.  
  631. /*______________________________________________________________________
  632.  
  633.     hlp_Save - Save Help Document.
  634.     
  635.     Entry:        prompt = prompt string for standard file dialog.
  636.                     defName = default file name for standard file dialog.
  637.                     creator = creator type for saved text file.
  638.                     menuPick = true if save operation was initiated via a 
  639.                         menu pick, false if it was initiated via a command key.
  640.                         
  641.     Exit:            function result = os error code.
  642. _____________________________________________________________________*/
  643.     
  644.     
  645. OSErr hlp_Save (Str255 prompt, Str255 defName, OSType creator, 
  646.     Boolean menuPick)
  647.  
  648. {
  649.     Boolean            good;            /* true if file saved */
  650.     
  651.     return rep_Save (Report, prompt, defName, creator, &good, menuPick);
  652. }
  653.  
  654. /*______________________________________________________________________
  655.  
  656.     hlp_GetScrollPos - Get Help Window Scrolling Position.
  657.     
  658.     Exit:            function result = window scrolling position (line number
  659.                         at top of window).
  660. _____________________________________________________________________*/
  661.  
  662.  
  663. short hlp_GetScrollPos (void)
  664.  
  665. {
  666.     return rep_GetPos(Report);
  667. }
  668.  
  669. /*______________________________________________________________________
  670.  
  671.     hlp_GetTconRect - Get Help Window Table of Contents Rectangle.
  672.     
  673.     Exit:        tconRect = tcon rectangle.
  674. _____________________________________________________________________*/
  675.  
  676.  
  677. void hlp_GetTconRect (Rect *tconRect)
  678.  
  679. {
  680.     *tconRect = P.tabConRect;
  681. }
  682.